﻿<Window x:Class="WTD.Admin.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:local="clr-namespace:WTD.Admin"
        mc:Ignorable="d" Loaded="Window_Loaded"
        Title="新装备编辑器" Height="350" Width="525">
    <DockPanel Margin="10">
        <Grid DockPanel.Dock="Top">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="名称" Margin="10,3,10,10"/>
            <TextBox Grid.Column="1" Margin="0,0,0,10" Height="21" Text="{Binding Item.Name}"/>
            <TextBlock Text="类型" Margin="10,3,10,10" Grid.Row="1"/>
            <ComboBox Grid.Column="1" Margin="0,0,0,10" Grid.Row="1" IsEditable="True" Text="{Binding Item.Type}" ItemsSource="{Binding Types}"/>
            <TextBlock Text="图标" Margin="10,3,10,10" Grid.Row="2"/>
            <ComboBox Grid.Column="1" Margin="0,0,0,10" Grid.Row="2" IsEditable="True" Text="{Binding Item.Icon}" ItemsSource="{Binding Icons}"/>
        </Grid>
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Margin="0,10,0,0">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Padding" Value="10,5"/>
                    <Setter Property="Margin">
                        <Setter.Value>
                            <Thickness Right="10" />
                        </Setter.Value>
                    </Setter>
                </Style>
            </StackPanel.Resources>
            <Button Name="btnSave" Click="btnSave_Click">保存</Button>
            <Button Name="btnReset" Click="btnReset_Click">重置</Button>
            <TextBlock Text="{Binding Status}" VerticalAlignment="Center"/>
        </StackPanel>
        <DataGrid DockPanel.Dock="Bottom" ItemsSource="{Binding No2infoes}" AutoGenerateColumns="False"
                  HorizontalGridLinesBrush="WhiteSmoke" VerticalGridLinesBrush="WhiteSmoke" AlternatingRowBackground="Azure">
            <DataGrid.Columns>
                <DataGridTextColumn Header="2号舰名" Binding="{Binding Name}"/>
                <DataGridTextColumn Header="周表达式" Binding="{Binding Weekdays}"/>
                <DataGridTextColumn Header="更新目标" Binding="{Binding Target,TargetNullValue={x:Static sys:String.Empty}}"/>
                <DataGridTextColumn Header="消耗表达式" Binding="{Binding Cost,TargetNullValue={x:Static sys:String.Empty}}"/>
            </DataGrid.Columns>
        </DataGrid>
    </DockPanel>
</Window>
